package router

import (
	"github.com/gin-gonic/gin"
	"vrcm/src/vrcm/app/admin/apis/domain"
	"vrcm/src/vrcm/app/admin/router"
)

func init() {
	router.NoCheckRole = append(router.NoCheckRole, registerDomainConfigRouter)
}

// registerDomainConfigRouter
func registerDomainConfigRouter(v1 *gin.RouterGroup) {
	api := apis.DomainConfig{}
	r := v1.Group("/domain")
	{
		r.POST("get-list", api.GetPage)
		r.GET("/:id", api.Get)
		r.POST("insert", api.Insert)
		r.POST("/update", api.Update)
		r.POST("/update-domain", api.UpdateDomain)
		r.POST("/delete", api.Delete)
		r.POST("/save-back-source-config", api.SaveBackSourceConfig)
		r.POST("/save-source-station-config", api.SaveSourceStationConfig)
		r.POST("/delete-source-station-config", api.DeleteSourceStationConfig)
		r.POST("/save-cache-expire-config", api.SaveCacheExpireConfig)
		r.POST("/save-state-code-expire-config", api.SaveStateCodeExpireConfig)
		r.POST("/delete-cache-expire-config", api.DeleteCacheExpireConfig)
		r.POST("/delete-state-code-expire-config", api.DeleteStateCodeExpireConfig)
		r.POST("/save-cache-filter-config", api.SaveCacheFilterConfig)
		r.POST("/delete-cache-filter-config", api.DeleteCacheFilterConfig)
		r.POST("/save-distribution-protocol-config", api.SaveDistributionProtocol)
		r.POST("/start-domain", api.StartDomain)
		r.POST("/stop-domain", api.StopDomain)
		r.POST("/up-or-down", api.RecordUpOrDown)
		r.POST("/domain-owner-verify", api.DomainOwnerVerify)
		r.POST("/domain-owner-verify2", api.DomainOwnerVerify2)
		r.POST("/save-anti-theft-config", api.SaveAntiTheftConfig)
		r.POST("/save-url-sign", api.SaveUrlSign)
		r.POST("/save-over-write-url", api.SaveOverWriteUrl)
		r.POST("/get-over-write-url", api.GetOverWriteUrl)
		r.POST("/delete-over-write-url", api.DeleteOverWriteUrl)
		r.POST("/move-down", api.MoveDown)
		r.POST("/get-domain", api.GetDomain)
		r.POST("/save-multi-cache-expire-config", api.SaveMultiCacheExpireConfig)
		r.POST("/save-multi-cache-filter-config", api.SaveMultiCacheFilterConfig)
		r.POST("/save-multi-state-code-expire-config", api.SaveMultiStateCodeExpireConfig)
		r.POST("/save-multi-header-config", api.SaveMultiHeaderConfig)
		r.POST("/save-compress-config", api.SaveCompressConfig)
		r.POST("/get-ip-info", api.GetIpInfo)
	}
}
